//
//  UserManager.swift
//  ImGuider X
//
//  Created by 陆涛 on 2018/9/28.
//  Copyright © 2018 imguider. All rights reserved.
//

import UIKit

class UserManager: NSObject {

    /// 单例对象
    static let share = UserManager()
    
    private var _token:String?
    
    var token:String? {
        
        set {
            _token = newValue
            UserDefaults.standard.set(newValue, forKey: "token")
            UserDefaults.standard.synchronize()
        }
        get {
            
            if _token == nil {
                
                _token = UserDefaults.standard.string(forKey: "token")
            }
            return _token
        }
    }
}
